<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>海内存知已，天涯若比邻 - 无唯</title><meta name="keywords" content="关键字"><meta name="author" content="mowei"><meta name="copyright" content="mowei"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="没事瞎记记，生活更有趣">
<meta property="og:type" content="website">
<meta property="og:title" content="海内存知已，天涯若比邻">
<meta property="og:url" content="https://gitee.com/momomomowei/page/2/index.html">
<meta property="og:site_name" content="海内存知已，天涯若比邻">
<meta property="og:description" content="没事瞎记记，生活更有趣">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/momomomowei/media/avatar.jpg">
<meta property="article:author" content="mowei">
<meta property="article:tag" content="关键字">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/momomomowei/media/avatar.jpg"><link rel="shortcut icon" href="/media/favicon.png"><link rel="canonical" href="https://gitee.com/momomomowei/page/2/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: true,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '海内存知已，天涯若比邻',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2024-04-21 15:25:55'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const fontSizeVal = saveToLocal.get('global-font-size')
    if (fontSizeVal !== undefined) {
      document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
    }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    document.addEventListener('pjax:complete', detectApple)})(window)</script><meta name="generator" content="Hexo 5.4.2"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="/media/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">41</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">29</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 目录</span><i class="fas fa-chevron-down expand hide"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('/media/bg.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">海内存知已，天涯若比邻</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 目录</span><i class="fas fa-chevron-down expand hide"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">海内存知已，天涯若比邻</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="mailto:你的邮箱" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/web/0%20vue3%E9%A1%B9%E7%9B%AE%E5%88%9B%E5%BB%BA%E6%89%8B%E5%86%8C/" title="Vue3 项目创建">     <img class="post_bg" src= "" data-lazy-src="/images/vue.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Vue3 项目创建"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/web/0%20vue3%E9%A1%B9%E7%9B%AE%E5%88%9B%E5%BB%BA%E6%89%8B%E5%86%8C/" title="Vue3 项目创建">Vue3 项目创建</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-04-21T05:32:06.000Z" title="发表于 2024-04-21 13:32:06">2024-04-21</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%89%8D%E7%AB%AF/">前端</a></span></div><div class="content">1.项目初始化环境准备

node v16.14.2
pnpm 8.0.0

pnpm安装指令
npm i -g pnpm
项目初始化命令:
pnpm create vue
2.项目配置2.1 eslint配置1.1 安装eslint12345678910# 让所有与prettier规则存在冲突的Eslint rules失效，并使用prettier进行代码检查&quot;eslint-config-prettier&quot;: &quot;^8.6.0&quot;,&quot;eslint-plugin-import&quot;: &quot;^2.27.5&quot;,&quot;eslint-plugin-node&quot;: &quot;^11.1.0&quot;,# 运行更漂亮的Eslint，使prettier规则优先级更高，Eslint优先级低&quot;eslint-plugin-prettier&quot;: &quot;^4.2.1&quot;,# vue.js的Eslint插件（查找vue语法错误，发现错误指令，查找违规风格指南&quot;eslint-plugi ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/web/Pinia/" title="Pinia 使用">     <img class="post_bg" src= "" data-lazy-src="/images/pinia.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Pinia 使用"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/web/Pinia/" title="Pinia 使用">Pinia 使用</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-04-21T05:32:06.000Z" title="发表于 2024-04-21 13:32:06">2024-04-21</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%89%8D%E7%AB%AF/">前端</a></span></div><div class="content">Pinia 使用1起步 安装1.1安装123yarn add piniaornpm install pinia
1.2引入注册12345678import &#123; createApp &#125; from &#x27;vue&#x27;import App from &#x27;./App.vue&#x27;import &#123;createPinia&#125; from &#x27;pinia&#x27; const store = createPinia()let app = createApp(App)app.use(store)app.mount(&#x27;#app&#x27;)
2初始化仓库Store1.新建一个文件夹Store
2.新建文件[name].ts
3.定义仓库Store
1import &#123; defineStore &#125; from &#x27;pinia&#x27;
4.我们需要知道存储是使用定义的defineStore()，并且它需要一个唯一的名称，作为第一个参数传递
新建文件store-namespace/index.ts
1 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/web/01%20React%20%E5%B8%B8%E7%94%A8/" title="React 常用">     <img class="post_bg" src= "" data-lazy-src="/images/react.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="React 常用"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/web/01%20React%20%E5%B8%B8%E7%94%A8/" title="React 常用">React 常用</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-04-21T05:32:06.000Z" title="发表于 2024-04-21 13:32:06">2024-04-21</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%89%8D%E7%AB%AF/">前端</a></span></div><div class="content">01 三个API12345678// 创建第一个divconst div = React.createElement(&#x27;div&#x27;, &#123;&#125;, &#x27;我是一个div&#x27;, button);// 获取根元素const root = ReactDOM.createRoot(document.getElementById(&#x27;root&#x27;));// 将元素在根元素中显示root.render(div);
02 函数组件12345678910111213const App = () =&gt; &#123;  return &lt;div&gt;我是App组件！&lt;/div&gt;&#125;;// 导出Appexport default App;// 使用// 获取根元素const root = ReactDOM.createRoot(document.getElementById(&#x27;root&#x27;));// 将元素在根元素中显示root.render(&lt;APP/&gt;);
03 事件1234567 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/web/react%20%E8%B7%AF%E7%94%B1%E6%87%92%E5%8A%A0%E8%BD%BD/" title="React 路由懒加载">     <img class="post_bg" src= "" data-lazy-src="/images/react.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="React 路由懒加载"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/web/react%20%E8%B7%AF%E7%94%B1%E6%87%92%E5%8A%A0%E8%BD%BD/" title="React 路由懒加载">React 路由懒加载</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-04-21T05:32:06.000Z" title="发表于 2024-04-21 13:32:06">2024-04-21</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%89%8D%E7%AB%AF/">前端</a></span></div><div class="content">react 路由懒加载main.js
1234567891011121314151617181920import React, &#123;Suspense&#125; from &#x27;react&#x27;import ReactDOM from &#x27;react-dom/client&#x27;import App from &#x27;@/App&#x27;import &#123;RouterProvider&#125; from &quot;react-router-dom&quot;import &#x27;normalize.css&#x27;import &#x27;@/assets/css/index.less&#x27;import router from &#x27;@/router&#x27;import &#123;Provider&#125; from &quot;react-redux&quot;import store from &#x27;@/store&#x27;const root = ReactDOM.createRoot(docum ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/web/Vue3%E5%85%A8%E5%AE%B6%E6%A1%B6/" title="Vue3 常用">     <img class="post_bg" src= "" data-lazy-src="/images/vue.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Vue3 常用"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/web/Vue3%E5%85%A8%E5%AE%B6%E6%A1%B6/" title="Vue3 常用">Vue3 常用</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-04-21T05:32:06.000Z" title="发表于 2024-04-21 13:32:06">2024-04-21</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%89%8D%E7%AB%AF/">前端</a></span></div><div class="content">一、Vue3基础参考链接：https://blog.csdn.net/qq1195566313/category_11618172.html?spm=1001.2014.3001.5482
1、Ref全家桶1 ref
接受一个内部值并返回一个响应式且可变的 ref 对象。ref 对象仅有一个 .value property，指向该内部值。

12345678910111213&lt;template&gt;  &lt;div&gt;    &lt;button @click=&quot;changeMsg&quot;&gt;change&lt;/button&gt;    &lt;div&gt;&#123;&#123; message &#125;&#125;&lt;/div&gt;  &lt;/div&gt;&lt;/template&gt; &lt;script setup lang=&quot;ts&quot;&gt;let message: string = &quot;我是message&quot;const changeMsg = () =&gt; &#123;   mes ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/linux/vim%E5%B8%B8%E7%94%A8%E6%93%8D%E4%BD%9C/" title="vim常用操作">     <img class="post_bg" src= "" data-lazy-src="/images/vim.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="vim常用操作"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/linux/vim%E5%B8%B8%E7%94%A8%E6%93%8D%E4%BD%9C/" title="vim常用操作">vim常用操作</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-04-21T05:20:06.000Z" title="发表于 2024-04-21 13:20:06">2024-04-21</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Linux/">Linux</a></span></div><div class="content">1、复制1）单行复制在命令模式下，将光标移动到将要复制的行处，按“yy”进行复制；
2）多行复制在命令模式下，将光标移动到将要复制的首行处，按“nyy”复制n行；其中n为1、2、3……
【yy】 复制光标所在的那一行【nyy】 复制光标所在的向下n行
2、粘贴在命令模式下，将光标移动到将要粘贴的行处，按“p”进行粘贴
【p,P】 p为将已经复制的数据在光标下一行粘贴；P为将已经复制的数据在光标上一行粘贴
3、删除删除一行：dd
删除一个单词/光标之后的单词剩余部分：dw
删除当前字符：x
光标之后的该行部分：d$
文本删除
dd 删除一行
d$ 删除以当前字符开始的一行字符
ndd 删除以当前行开始的n行
dw 删除以当前字符开始的一个字
ndw 删除以当前字符开始的n个字
4、查找【/word】 在文件中查找内容为word的字符串（向下查找）【?word】 在文件中查找内容为word的字符串（向上查找）【[n]】 表示重复查找动作，即查找下一个【[N]】 反向查找下一个
搜索后，我们打开别的文件，发现也被高亮了，怎么关闭高亮？
命令模式下，输入:nohlsearch  也可以:set ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/java/107%20Swagger2/" title="SpringBoot 使用 Swagger2">     <img class="post_bg" src= "" data-lazy-src="/images/spring.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SpringBoot 使用 Swagger2"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/java/107%20Swagger2/" title="SpringBoot 使用 Swagger2">SpringBoot 使用 Swagger2</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-04-20T06:24:43.000Z" title="发表于 2024-04-20 14:24:43">2024-04-20</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Java/">Java</a></span></div><div class="content">参考链接： https://blog.csdn.net/gaohuanjie/article/details/127887519
1 引入依赖12345 &lt;dependency&gt;     &lt;groupId&gt;io.springfox&lt;/groupId&gt;     &lt;artifactId&gt;springfox-boot-starter&lt;/artifactId&gt;     &lt;version&gt;3.0.0&lt;/version&gt;&lt;/dependency&gt;
2 启用Swagger2
在启动类上或者配置类加 @EnableSwagger2  @EnableWebMvc 注解

12345678@SpringBootApplication@EnableWebMvc@EnableSwagger2public class SanGengBlogApplication &#123;    public static void main(String[] args) &#123;        SpringApplicati ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/java/108%20aop%20%E6%93%8D%E4%BD%9C%E6%97%A5%E5%BF%97/" title="SpringBoot aop 记录日志">     <img class="post_bg" src= "" data-lazy-src="/images/spring.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SpringBoot aop 记录日志"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/java/108%20aop%20%E6%93%8D%E4%BD%9C%E6%97%A5%E5%BF%97/" title="SpringBoot aop 记录日志">SpringBoot aop 记录日志</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-04-18T06:24:43.000Z" title="发表于 2024-04-18 14:24:43">2024-04-18</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Java/">Java</a></span></div><div class="content">1 添加依赖12345678910111213141516 &lt;dependency&gt;     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;     &lt;artifactId&gt;spring-boot-starter-aop&lt;/artifactId&gt;&lt;/dependency&gt;&lt;dependency&gt;    &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;    &lt;artifactId&gt;lombok&lt;/artifactId&gt;    &lt;optional&gt;true&lt;/optional&gt;&lt;/dependency&gt;&lt;dependency&gt;    &lt;groupId&gt;com.alibaba&lt;/groupId&gt;    &lt;artifactId&gt;fastjson&lt;/artifactId&gt;    &lt;version&gt ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/java/01%20SpringAMQP%20%E5%BF%AB%E9%80%9F%E4%BD%BF%E7%94%A8/" title="SpringAMQP 快速使用">     <img class="post_bg" src= "" data-lazy-src="/images/rabbitmq.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SpringAMQP 快速使用"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/java/01%20SpringAMQP%20%E5%BF%AB%E9%80%9F%E4%BD%BF%E7%94%A8/" title="SpringAMQP 快速使用">SpringAMQP 快速使用</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-03-30T07:24:43.000Z" title="发表于 2024-03-30 15:24:43">2024-03-30</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Java/">Java</a></span></div><div class="content">一、新建工程1.依赖12345&lt;!--AMQP依赖，包含RabbitMQ--&gt;&lt;dependency&gt;    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;    &lt;artifactId&gt;spring-boot-starter-amqp&lt;/artifactId&gt;&lt;/dependency&gt;
2.配置12345678910111213141516# 应用名称spring:  application:    name: rabbit-publisher    #name: rabbit-consumer  rabbitmq:    host: 182.61.55.41 # 主机名    port: 5672 # 端口    virtual-host: / # 虚拟主机    username: root # 用户名    password: momo123456... # 密码# 应用服务 WEB 访问端口server:  port: 9999
二、SpringAMQP ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/jenkins/%E9%83%A8%E7%BD%B2spring%E9%A1%B9%E7%9B%AE/" title="Jenkins 部署spring项目">     <img class="post_bg" src= "" data-lazy-src="/images/spring.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Jenkins 部署spring项目"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/jenkins/%E9%83%A8%E7%BD%B2spring%E9%A1%B9%E7%9B%AE/" title="Jenkins 部署spring项目">Jenkins 部署spring项目</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-03-18T06:06:43.000Z" title="发表于 2024-03-18 14:06:43">2024-03-18</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/jenkins/">jenkins</a></span></div><div class="content">部署spring项目远程执行的shell脚本(SSH Publishers)
# 删除旧文件
rm -fr /home/target/$JOB_BASE_NAME

# 创建工作文件夹
mkdir -p /home/target/$JOB_BASE_NAME

# 进入jekins工作目录
cd /home/jenkins_home/jobs/$JOB_BASE_NAME/modules

# 查找并复制最新的jar文件
cp $(find . -name &quot;*.jar&quot; -type f -print0 | xargs -0 ls -c | head -n 1) /home/target/$JOB_BASE_NAME/app.jar

# 查找dockerfile文件
cd /home/jenkins_home/workspace/$JOB_BASE_NAME

# 复制dockerfile文件
cp $(find . -name &quot;dockerfile&quot; -type f) /home/target/$JOB_BASE_NAME/

#进入文件夹 ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/">1</a><span class="page-number current">2</span><a class="page-number" href="/page/3/#content-inner">3</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/#content-inner">5</a><a class="extend next" rel="next" href="/page/3/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">一切解释权归本咸鱼所有</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/blog/java/01%20Spring%20Security%20&amp;%20oauth2/" title="Spring Security &amp; Oauth2"><img src= "" data-lazy-src="/images/spring-security.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Spring Security &amp; Oauth2"/></a><div class="content"><a class="title" href="/blog/java/01%20Spring%20Security%20&amp;%20oauth2/" title="Spring Security &amp; Oauth2">Spring Security &amp; Oauth2</a><time datetime="2024-04-25T07:24:45.000Z" title="发表于 2024-04-25 15:24:45">2024-04-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/java/02%20JWT%E5%B7%A5%E5%85%B7%E7%B1%BB/" title="JWT工具类"><img src= "" data-lazy-src="/images/jwt.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JWT工具类"/></a><div class="content"><a class="title" href="/blog/java/02%20JWT%E5%B7%A5%E5%85%B7%E7%B1%BB/" title="JWT工具类">JWT工具类</a><time datetime="2024-04-25T07:24:45.000Z" title="发表于 2024-04-25 15:24:45">2024-04-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/java/00%20Security%20%E9%9B%86%E6%88%90%E7%A4%BA%E4%BE%8B/" title="SpringSecurity 集成示例"><img src= "" data-lazy-src="/images/spring-security.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SpringSecurity 集成示例"/></a><div class="content"><a class="title" href="/blog/java/00%20Security%20%E9%9B%86%E6%88%90%E7%A4%BA%E4%BE%8B/" title="SpringSecurity 集成示例">SpringSecurity 集成示例</a><time datetime="2024-04-25T07:24:43.000Z" title="发表于 2024-04-25 15:24:43">2024-04-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/java/101%20Mybatis-plus%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90/" title="MybatisPlus 快速集成"><img src= "" data-lazy-src="/images/mybatis-plus.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="MybatisPlus 快速集成"/></a><div class="content"><a class="title" href="/blog/java/101%20Mybatis-plus%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90/" title="MybatisPlus 快速集成">MybatisPlus 快速集成</a><time datetime="2024-04-21T07:39:43.000Z" title="发表于 2024-04-21 15:39:43">2024-04-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/java/10%20Mybatis%20%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90/" title="Mybatis 快速集成"><img src= "" data-lazy-src="/images/mybaits.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Mybatis 快速集成"/></a><div class="content"><a class="title" href="/blog/java/10%20Mybatis%20%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90/" title="Mybatis 快速集成">Mybatis 快速集成</a><time datetime="2024-04-21T07:24:43.000Z" title="发表于 2024-04-21 15:24:43">2024-04-21</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Java/"><span class="card-category-list-name">Java</span><span class="card-category-list-count">15</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Linux/"><span class="card-category-list-name">Linux</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/docker/"><span class="card-category-list-name">docker</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/jenkins/"><span class="card-category-list-name">jenkins</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/nginx/"><span class="card-category-list-name">nginx</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%89%8D%E7%AB%AF/"><span class="card-category-list-name">前端</span><span class="card-category-list-count">6</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%B7%A5%E5%85%B7%E5%87%BD%E6%95%B0/"><span class="card-category-list-name">工具函数</span><span class="card-category-list-count">9</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/Base64/" style="font-size: 1.1em; color: #999">Base64</a> <a href="/tags/Blob/" style="font-size: 1.15em; color: #999b9e">Blob</a> <a href="/tags/JWT/" style="font-size: 1.1em; color: #999">JWT</a> <a href="/tags/Java/" style="font-size: 1.5em; color: #99a9bf">Java</a> <a href="/tags/Linux/" style="font-size: 1.3em; color: #99a1ac">Linux</a> <a href="/tags/Mybatis/" style="font-size: 1.15em; color: #999b9e">Mybatis</a> <a href="/tags/Oauth2/" style="font-size: 1.1em; color: #999">Oauth2</a> <a href="/tags/Pinia/" style="font-size: 1.1em; color: #999">Pinia</a> <a href="/tags/RabbitMQ/" style="font-size: 1.1em; color: #999">RabbitMQ</a> <a href="/tags/React/" style="font-size: 1.15em; color: #999b9e">React</a> <a href="/tags/Redis/" style="font-size: 1.15em; color: #999b9e">Redis</a> <a href="/tags/Security/" style="font-size: 1.15em; color: #999b9e">Security</a> <a href="/tags/SpringBoot/" style="font-size: 1.4em; color: #99a5b6">SpringBoot</a> <a href="/tags/Vue/" style="font-size: 1.25em; color: #999fa7">Vue</a> <a href="/tags/canvas/" style="font-size: 1.1em; color: #999">canvas</a> <a href="/tags/centos/" style="font-size: 1.1em; color: #999">centos</a> <a href="/tags/docker/" style="font-size: 1.1em; color: #999">docker</a> <a href="/tags/jdk/" style="font-size: 1.1em; color: #999">jdk</a> <a href="/tags/jenkins/" style="font-size: 1.15em; color: #999b9e">jenkins</a> <a href="/tags/maven/" style="font-size: 1.1em; color: #999">maven</a> <a href="/tags/minio/" style="font-size: 1.1em; color: #999">minio</a> <a href="/tags/mysql/" style="font-size: 1.1em; color: #999">mysql</a> <a href="/tags/nacos/" style="font-size: 1.1em; color: #999">nacos</a> <a href="/tags/nginx/" style="font-size: 1.2em; color: #999da3">nginx</a> <a href="/tags/tomcat/" style="font-size: 1.1em; color: #999">tomcat</a> <a href="/tags/uni-app/" style="font-size: 1.1em; color: #999">uni-app</a> <a href="/tags/web/" style="font-size: 1.35em; color: #99a3b1">web</a> <a href="/tags/%E5%89%8D%E7%AB%AF/" style="font-size: 1.45em; color: #99a7ba">前端</a> <a href="/tags/%E6%B0%B4%E5%8D%B0/" style="font-size: 1.1em; color: #999">水印</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/04/"><span class="card-archive-list-date">四月 2024</span><span class="card-archive-list-count">18</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/03/"><span class="card-archive-list-date">三月 2024</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/02/"><span class="card-archive-list-date">二月 2024</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/01/"><span class="card-archive-list-date">一月 2024</span><span class="card-archive-list-count">7</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/11/"><span class="card-archive-list-date">十一月 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/04/"><span class="card-archive-list-date">四月 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/03/"><span class="card-archive-list-date">三月 2023</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/09/"><span class="card-archive-list-date">九月 2021</span><span class="card-archive-list-count">3</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">41</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2022-03-10T16:00:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">112.5k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-04-21T07:25:54.443Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2024 By mowei</div><div class="footer_custom_text">海内存知已，天涯若比邻</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function subtitleType () {
  if (true) { 
    var typed = new Typed("#subtitle", {
      strings: "知识来自实践。,Knowledge comes from experience alone.,世间无所谓天才，它仅是刻苦加勤奋。,There is no such thing as genius; it is nothing but labour and diligence.".split(","),
      startDelay: 300,
      typeSpeed: 150,
      loop: true,
      backSpeed: 50
    })
  } else {
    document.getElementById("subtitle").innerHTML = '知识来自实践。'
  }
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}</script><script>if (document.getElementsByClassName('mermaid').length) {
  if (window.mermaidJsLoad) mermaid.init()
  else {
    getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(() => {
      window.mermaidJsLoad = true
      mermaid.initialize({
        theme: 'default',
      })
      true && mermaid.init()
    })
  }
}</script></div><div class="aplayer no-destroy" data-id="9385310356" data-server="netease" data-type="playlist" data-fixed="true" data-mini="true" data-listFolded="false" data-order="random" data-preload="none" data-autoplay="true" muted></div><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js"></script><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = [
  'title',
  '#config-diff',
  '#body-wrap',
  '#rightside-config-hide',
  '#rightside-config-show',
  '.js-pjax'
]

if (false) {
  pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
}

var pjax = new Pjax({
  elements: 'a:not([target="_blank"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:send', function () {

  // removeEventListener scroll 
  window.removeEventListener('scroll', window.tocScrollFn)
  window.removeEventListener('scroll', scrollCollect)

  typeof preloader === 'object' && preloader.initLoading()
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  // google analytics
  typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});

  // baidu analytics
  typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // Analytics
  if (false) {
    MtaH5.pgv()
  }

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()

  typeof preloader === 'object' && preloader.endLoading()
})

document.addEventListener('pjax:error', (e) => {
  if (e.request.status === 404) {
    pjax.loadUrl('/404.html')
  }
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script src="/live2d_models/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2d_models/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2d_models/assets/wanko.model.json"},"display":{"position":"left","width":100,"height":150,"hOffset":-10,"vOffset":40},"mobile":{"show":true},"react":{"opacity":0.7},"log":false});</script></body></html>